package com.agp.controller;

/**
 * Created by anguangpei on 2018/10/28.
 */

import com.agp.api.test.IHelloApi;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * feign 示例
 *
 * @author OKong
 */
@RestController
@Slf4j
public class DemoController {

    @Autowired
    private IHelloApi iHelloClient;

    @GetMapping("/hello")
    public String hello(@RequestParam("name") String name) {
        log.info("使用feign调用服务，参数name:{}", name);
        return iHelloClient.index(name);
    }
}